import axios from "axios";
//l_66ab9c61e4b0d84dab0e1af0

function fetchGoodsList(alive_id, app_id) {
  return axios.post("/_alive/xe.ecommerce.marketing.list.get/3.0.0", {
    alive_id,
    app_id,
    page: 1,
    page_size: 20,
    port: 1,
  });
}

function fetchAliveInfo(alive_id) {
  return axios.get(
    `/_alive/v3/base_info?resource_id=${alive_id}&product_id=&type=12&is_direct=1`
  );
}

export function fetchInfo(alive_id, app_id) {
  return Promise.all([fetchAliveInfo(alive_id), fetchGoodsList(alive_id, app_id)]).then(
    ([res1, res2]) => {
      console.log(res1,res2);
      
      return {
        aliveInfo: res1.data.alive_info,
        goodsList: res2.data,
      };
    }
  );
}

export const liveInfo = {
  alive_conf: {
    alive_mode: 0,
    alive_tab: 0,
    alive_type_state: 1,
    anti_screen_capture: 0,
    app_anti_screen_capture: 0,
    app_anti_screen_jump: 0,
    authentic_state: 1,
    can_record: 0,
    complete_time: 0,
    cutting_type: 0,
    eclockwm_anti_screen_jump: 0,
    elearn_anti_screen_capture: 0,
    elearn_anti_screen_jump: 0,
    elive_anti_screen_jump: 0,
    elive_anti_screen_jump_url: "",
    esnswm_anti_screen_jump: 0,
    esnswmd_anti_screen_jump: 0,
    forbid_record: 1,
    forbid_talk: 0,
    guide_binding_phone_switch: 0,
    h5_anti_screen_jump: 0,
    h5_anti_screen_jump_url: "",
    h5_url: "https://appo9Jt818w4093.h5.xiaoeknow.com",
    has_invite: 1,
    has_reward: 1,
    if_push: 2,
    is_audit_first_on: 0,
    is_can_exceptional: 0,
    is_card_on: 0,
    is_coupon_on: 1,
    is_force_fast: 0,
    is_heat_on: 0,
    is_hor_float_card_on: 1,
    is_invite_data_on: 0,
    is_invite_on: 1,
    is_jump_full_screen: 1,
    is_lookback: 1,
    is_marketing_entry_on: 0,
    is_message_on: 0,
    is_msg_script: 0,
    is_online_on: 1,
    is_open_complete_time: 0,
    is_open_ego_mode: 0,
    is_open_points: 0,
    is_open_promoter: 0,
    is_open_qus: 1,
    is_open_share_reward: 0,
    is_open_task: 0,
    is_open_vote: 1,
    is_picture_on: 0,
    is_point_red_packet_on: 0,
    is_privacy_protection: 0,
    is_prize_on: 0,
    is_red_packet_on: 0,
    is_redirect_index: 0,
    is_round_table_on: 0,
    is_set_preview: 0,
    is_show_marquee: 0,
    is_show_reward: 0,
    is_show_reward_on: 1,
    is_show_view_count: 1,
    is_sign_in_on: 1,
    is_takegoods: 1,
    is_thumb_on: 1,
    lookback_time: {
      expire: -1,
      expire_type: 1,
    },
    msg_bubble_type: 1,
    only_h5_play: 0,
    open_pc_network_school: 1,
    pc_network_school_index_url: "",
    privacy_protection_live: 0,
    red_packet_switch: 0,
    relate_sell_info: 1,
    reward_switch: 1,
    share_file_switch: 1,
    show_on_wall: 1,
    show_on_wall_switch: 1,
    version_type: 4,
    video_player_type: 0,
    view_in_mini_program: 1,
    view_stop_switch: 1,
    warm_up: 1,
    wm_anti_screen_jump: 0,
    wx_app_avatar:
      "http://wechatapppro-1252524126.file.myqcloud.com/appo9Jt818w4093/image/kh344jdc0lnlcbdb0ckq.jpg",
    wx_app_name: "电商独立车专用-外灰（个人）",
  },
  alive_info: {
    alive_id: "l_66ab9c61e4b0d84dab0e1af0",
    alive_img_url:
      "https://commonresource-1252524126.cdn.xiaoeknow.com/image/lr4dye8f02d5.jpg?imageView2/w/1050/q/100/rq/100|imageMogr2/ignore-error/1",
    alive_room_url:
      "https://appo9Jt818w4093.h5.xiaoeknow.com/v2/course/alive/l_66ab9c61e4b0d84dab0e1af0?app_id=appo9Jt818w4093&pro_id=&type=2",
    alive_state: 3,
    alive_type: 2,
    app_id: "appo9Jt818w4093",
    can_select: 1,
    checktimestamp: 1726047483,
    comment_count: 0,
    cover_img_url:
      "https://commonresource-1252524126.cdn.xiaoeknow.com/image/l6nfw9120t1u.png",
    create_mode: 0,
    created_at: "2024-08-01 22:32:01",
    descrb: "",
    img_url:
      "https://commonresource-1252524126.cdn.xiaoeknow.com/image/l6nfw9120t1u.png",
    img_url_compressed:
      "https://commonresource-1252524126.cdn.xiaoeknow.com/image/l6nfw9120t1u.png",
    manual_stop_at: null,
    old_live_room_url:
      "/content_page/eyJ0eXBlIjoxMiwicmVzb3VyY2VfdHlwZSI6NCwicmVzb3VyY2VfaWQiOiJsXzY2YWI5YzYxZTRiMGQ4NGRhYjBlMWFmMCIsInByb2R1Y3RfaWQiOiIiLCJwYXltZW50X3R5cGUiOjEsImNoYW5uZWxfaWQiOiIiLCJhcHBfaWQiOiJhcHBvOUp0ODE4dzQwOTMiLCJzb3VyY2UiOiIiLCJzY2VuZSI6IiIsImNvbnRlbnRfYXBwX2lkIjoiIiwiZXh0cmFfZGF0YSI6MCwid2ViX2FsaXZlIjowLCJ0b2tlbiI6IiJ9",
    org_content: "",
    param_str:
      "eyJwYXltZW50X3R5cGUiOjIsInByb2R1Y3RfaWQiOiIiLCJyZXNvdXJjZV9pZCI6ImxfNjZhYjljNjFlNGIwZDg0ZGFiMGUxYWYwIiwicmVzb3VyY2VfdHlwZSI6NH0",
    product_id: "",
    product_name: "",
    push_ahead: "5",
    push_state: 2,
    push_url: "",
    pushzb_start_at: "2024-08-01 23:00:00",
    pushzb_stop_at: "2024-08-02 00:00:00",
    record_push_end_time: "2024-08-01 22:59:00",
    remainder_time: 0,
    resource_type: 4,
    room_id: "XET#2a1e93e210073e339",
    sell_mode: 0,
    summary: "",
    title: "直播间看看优惠券",
    user_title: "",
    user_type: 0,
    view_count: 2,
    zb_countdown_time: -3523143,
    zb_start_at: 1722524400,
    zb_stop_at: 1722528000,
  },
  alive_play: {
    pc_alive_video_url:
      "http://liveplay-hw-flv.xiaoeknow.com/live/5060_2a1e93e1900113821.flv",
    mini_alive_video_url:
      "http://liveplay.xiaoeknow.com/live/5060_2a1e93e1900113821.m3u8",
    alive_video_url:
      "http://liveplay.xiaoeknow.com/live/5060_2a1e93e1900113821.m3u8",
    new_alive_host: "live-flexible.xiaoeknow.com/live/",
    alive_fast_webrtcurl:
      "webrtc://liveplay.xiaoeknow.com/live/5060_2a1e93e1900113821",
    new_alive_video_url: "",
    fast_alive_switch: true,
    video_alive_use_cos: false,
    alive_video_more_sharpness: [
      {
        definition_name: "原画",
        definition_p: "default",
        encrypt: "",
        url: "http://liveplay-hw-hls.xiaoeknow.com/live/5060_2a1e93e1900113821.m3u8",
      },
      {
        definition_name: "高清",
        definition_p: "hd",
        encrypt: "",
        url: "http://liveplay-hw-hls.xiaoeknow.com/live/5060_2a1e93e1900113821_720P.m3u8",
      },
      {
        definition_name: "流畅",
        definition_p: "fluent",
        encrypt: "",
        url: "http://liveplay.xiaoeknow.com/live/5060_2a1e93e1900113821_720P.m3u8",
      },
    ],
    pc_alive_video_more_sharpness: [
      {
        definition_name: "原画",
        definition_p: "default",
        encrypt: "",
        url: "http://liveplay-hw-flv.xiaoeknow.com/live/5060_2a1e93e1900113821.flv",
      },
      {
        definition_name: "高清",
        definition_p: "hd",
        encrypt: "",
        url: "http://liveplay-hw-flv.xiaoeknow.com/live/5060_2a1e93e1900113821_720P.flv",
      },
      {
        definition_name: "流畅",
        definition_p: "fluent",
        encrypt: "",
        url: "http://liveplay.xiaoeknow.com/live/5060_2a1e93e1900113821_720P.flv",
      },
    ],
    alive_fast_more_sharpness: [
      {
        definition_name: "原画",
        definition_p: "default",
        encrypt: "",
        url: "webrtc://liveplay.xiaoeknow.com/live/5060_2a1e93e1900113821",
      },
      {
        definition_name: "高清",
        definition_p: "hd",
        encrypt: "",
        url: "webrtc://liveplay.xiaoeknow.com/live/5060_2a1e93e1900113821_720P",
      },
      {
        definition_name: "流畅",
        definition_p: "fluent",
        encrypt: "",
        url: "webrtc://liveplay.xiaoeknow.com/live/5060_2a1e93e1900113821_720P",
      },
    ],
    recorded_use_pull_stream: false,
    alive_video_backup_more_sharpness: [
      [
        {
          definition_name: "原画",
          definition_p: "default",
          encrypt: "",
          url: "http://liveplay.xiaoeknow.com/live/5060_2a1e93e1900113821.m3u8",
        },
        {
          definition_name: "高清",
          definition_p: "hd",
          encrypt: "",
          url: "http://liveplay.xiaoeknow.com/live/5060_2a1e93e1900113821_720P.m3u8",
        },
        {
          definition_name: "流畅",
          definition_p: "fluent",
          encrypt: "",
          url: "http://liveplay.xiaoeknow.com/live/5060_2a1e93e1900113821_720P.m3u8",
        },
      ],
      [
        {
          definition_name: "原画",
          definition_p: "default",
          encrypt: "",
          url: "http://liveplay-byte.xiaoeknow.com/live/5060_2a1e93e1900113821.m3u8",
        },
        {
          definition_name: "高清",
          definition_p: "hd",
          encrypt: "",
          url: "http://liveplay-byte.xiaoeknow.com/live/5060_2a1e93e1900113821_720P.m3u8",
        },
        {
          definition_name: "流畅",
          definition_p: "fluent",
          encrypt: "",
          url: "http://liveplay-byte.xiaoeknow.com/live/5060_2a1e93e1900113821_720P.m3u8",
        },
      ],
    ],
    lines: [
      {
        line_name: "线路2",
        default: false,
        line_sharpness: [
          {
            name: "原画",
            resolution: "origin",
            url: "http://liveplay-byte.xiaoeknow.com/live/5060_2a1e93e1900113821.m3u8",
            default: true,
            cloud: "byte",
            type: "normal",
          },
          {
            name: "高清",
            resolution: "hd",
            url: "http://liveplay-byte.xiaoeknow.com/live/5060_2a1e93e1900113821_720P.m3u8",
            default: false,
            cloud: "byte",
            type: "normal",
          },
          {
            name: "流畅",
            resolution: "fluency",
            url: "http://liveplay-byte.xiaoeknow.com/live/5060_2a1e93e1900113821_720P.m3u8",
            default: false,
            cloud: "byte",
            type: "normal",
          },
        ],
      },
      {
        line_name: "线路3",
        default: false,
        line_sharpness: [
          {
            name: "原画",
            resolution: "origin",
            url: "http://liveplay.xiaoeknow.com/live/5060_2a1e93e1900113821.m3u8",
            default: true,
            cloud: "tx",
            type: "normal",
          },
          {
            name: "高清",
            resolution: "hd",
            url: "http://liveplay.xiaoeknow.com/live/5060_2a1e93e1900113821_720P.m3u8",
            default: false,
            cloud: "tx",
            type: "normal",
          },
          {
            name: "流畅",
            resolution: "fluency",
            url: "http://liveplay.xiaoeknow.com/live/5060_2a1e93e1900113821_720P.m3u8",
            default: false,
            cloud: "tx",
            type: "normal",
          },
        ],
      },
      {
        line_name: "线路4",
        default: true,
        line_sharpness: [
          {
            name: "原画",
            resolution: "origin",
            url: "webrtc://liveplay.xiaoeknow.com/live/5060_2a1e93e1900113821",
            default: true,
            cloud: "tx",
            type: "fast",
          },
          {
            name: "高清",
            resolution: "hd",
            url: "webrtc://liveplay.xiaoeknow.com/live/5060_2a1e93e1900113821_720P",
            default: false,
            cloud: "tx",
            type: "fast",
          },
          {
            name: "流畅",
            resolution: "fluency",
            url: "webrtc://liveplay.xiaoeknow.com/live/5060_2a1e93e1900113821_720P",
            default: false,
            cloud: "tx",
            type: "fast",
          },
        ],
      },
      {
        line_name: "线路5",
        default: false,
        line_sharpness: [
          {
            name: "原画",
            resolution: "origin",
            url: "http://liveplay-hw-hls.xiaoeknow.com/live/5060_2a1e93e1900113821.m3u8",
            default: true,
            cloud: "hw",
            type: "normal",
          },
          {
            name: "高清",
            resolution: "hd",
            url: "http://liveplay-hw-hls.xiaoeknow.com/live/5060_2a1e93e1900113821_720P.m3u8",
            default: false,
            cloud: "hw",
            type: "normal",
          },
          {
            name: "流畅",
            resolution: "fluency",
            url: "http://liveplay-hw-hls.xiaoeknow.com/live/5060_2a1e93e1900113821_720P.m3u8",
            default: false,
            cloud: "hw",
            type: "normal",
          },
        ],
      },
    ],
    elive_lines: [
      {
        line_name: "线路1",
        default: false,
        line_sharpness: [
          {
            name: "原画",
            resolution: "origin",
            url: "http://liveplay-byte.xiaoeknow.com/live/5060_2a1e93e1900113821.flv",
            default: true,
            cloud: "byte",
            type: "normal",
          },
          {
            name: "高清",
            resolution: "hd",
            url: "http://liveplay-byte.xiaoeknow.com/live/5060_2a1e93e1900113821_720P.flv",
            default: false,
            cloud: "byte",
            type: "normal",
          },
          {
            name: "流畅",
            resolution: "fluency",
            url: "http://liveplay-byte.xiaoeknow.com/live/5060_2a1e93e1900113821_720P.flv",
            default: false,
            cloud: "byte",
            type: "normal",
          },
        ],
      },
      {
        line_name: "线路2",
        default: false,
        line_sharpness: [
          {
            name: "原画",
            resolution: "origin",
            url: "http://liveplay.xiaoeknow.com/live/5060_2a1e93e1900113821.flv",
            default: true,
            cloud: "tx",
            type: "normal",
          },
          {
            name: "高清",
            resolution: "hd",
            url: "http://liveplay.xiaoeknow.com/live/5060_2a1e93e1900113821_720P.flv",
            default: false,
            cloud: "tx",
            type: "normal",
          },
          {
            name: "流畅",
            resolution: "fluency",
            url: "http://liveplay.xiaoeknow.com/live/5060_2a1e93e1900113821_720P.flv",
            default: false,
            cloud: "tx",
            type: "normal",
          },
        ],
      },
      {
        line_name: "线路3",
        default: true,
        line_sharpness: [
          {
            name: "原画",
            resolution: "origin",
            url: "http://liveplay-hw-flv.xiaoeknow.com/live/5060_2a1e93e1900113821.flv",
            default: true,
            cloud: "hw",
            type: "normal",
          },
          {
            name: "高清",
            resolution: "hd",
            url: "http://liveplay-hw-flv.xiaoeknow.com/live/5060_2a1e93e1900113821_720P.flv",
            default: false,
            cloud: "hw",
            type: "normal",
          },
          {
            name: "流畅",
            resolution: "fluency",
            url: "http://liveplay-hw-flv.xiaoeknow.com/live/5060_2a1e93e1900113821_720P.flv",
            default: false,
            cloud: "hw",
            type: "normal",
          },
        ],
      },
    ],
  },
  available_info: {
    available: true,
    available_product: false,
    expire_at: "",
    have_password: 0,
    is_public: 1,
    is_stop_sell: 0,
    is_try: 0,
    payment_type: 1,
    recycle_bin_state: 0,
  },
  campro_report: false,
  caption_define: {
    audio_try_hint: "购买",
    column_open: "订阅",
    column_pay_hint: "开通会员",
    column_title: "专栏",
    home_tab_message: "消息",
    home_title: "Tony的微页面",
    single_product_hint: "订阅专栏",
  },
  e_course_data: null,
  index_url: "https://appo9Jt818w4093.h5.xiaoeknow.com/homepage",
  is_static_switch: false,
  live_skin: {
    h5_link: "",
    key: "",
    type: 0,
  },
  payment_url: "",
  share_info: {
    share_info: {
      is_share_free: 0,
      share_user_id: "",
      num: 0,
      surplus_num: 0,
      share_resource: 0,
      has_share_resource: null,
      product_info: null,
    },
    share_listen_info: {
      is_share_listen: false,
      is_show_share_count: true,
    },
  },
}.alive_info;

export const goodsList = [
  {
    activity_price: 0,
    activity_type: 0,
    content_app_id: "",
    count: 10,
    coupon_id: ["cou_64897c6b61197-zxBAjF"],
    course_offline_type: 2,
    cr_id: "1",
    distribution_pattern: 1,
    end_at: "",
    err_code: 0,
    goods_brief_text: "",
    goods_desc: "",
    goods_type: 21,
    hide_sub_count: 1,
    id: "g_66ab999dea898_4J0Kb4zm88",
    img_url:
      "https://wechatapppro-1252524126.file.myqcloud.com/appo9Jt818w4093/image/LXhpYW9lX2Fzc2lzdGFudF9zZXJ2ZXItLTdyZGdxM1JI.jpg",
    is_activity: 0,
    is_display_package: 1,
    is_sell_out: 0,
    is_super_vip: 0,
    is_svip: 0,
    line_price: 0,
    now_stock: 0,
    order_num: 0,
    order_weight: 1,
    pageNum: 1,
    preferential_price: 0,
    price: 3,
    resource_id: "SPU_ENT_1722522014rmS606WfjSyBy",
    resource_rights_type: 0,
    resource_type: 21,
    resource_type_name: "实物商品",
    resource_type_name_en: "Entity",
    sec_kill_is_preheat: 0,
    sec_kill_is_subscribe: 0,
    sec_kill_preheat_time: "",
    sec_kill_subscribe_time: "",
    sec_kill_user_is_subscribe: 0,
    show_stock: 1,
    sku_floor_price: 0,
    spu_id: "SPU_ENT_1722522014rmS606WfjSyBy",
    spu_type: "ENT",
    start_at: "",
    stock: 10,
    svip_coupon_over: false,
    svip_discount: 0,
    svip_price: 0,
    target_url:
      "https://appo9Jt818w4093.h5.xiaoeknow.com/v1/goods/goods_detail/SPU_ENT_1722522014rmS606WfjSyBy?type=2",
    teacher_auth: 2,
    title: "内灰死锁",
    total: 1,
    true_type: 21,
  },
];
